package edu.scu.declaresys.vo;

import java.util.Date;

import edu.scu.declaresys.dao.util.Column;
import edu.scu.declaresys.dao.util.FieldWalker;
import edu.scu.declaresys.dao.util.Table;


/**
 * 
 * @author: zt
 * @since : 2013-7-3
 */
@Table(code = SysLog.T_TABLE)
public class SysLog implements java.io.Serializable
{
	private static final long	serialVersionUID	= -6420066912748945306L;
	//
	// table column name.
	//s
	public static final String	T_TABLE				= "sys_log";
	public static final String	T_ID				= "id";
	public static final String	T_TIME				= "time";
	public static final String	T_LEVEL				= "level";
	public static final String	T_MSG				= "msg";
	//
	// Fields
	//
	@Column(code = T_ID)
	private Integer				id;
	
	@Column(code = T_TIME)
	private Date				time;
	
	@Column(code = T_LEVEL)
	private Integer				level;
	
	@Column(code = T_MSG)
	private String				msg;
	
	//
	// Constructors
	//
	/** default constructor */
	public SysLog()
	{
	}
	
	/** full constructor */
	public SysLog(Date time, Integer level, String msg)
	{
		this.time = time;
		this.level = level;
		this.msg = msg;
	}
	//
	// Override functions.
	//
	public String toString()
	{
		return FieldWalker.makeNonstaticFields(this, FieldWalker.WITHOUT_NULL);
	}
	
	@Override
	public int hashCode()
	{
		return id.hashCode();
	}

	@Override
	public boolean equals(Object obj)
	{
		if(this == obj)
		{
			return true;
		}
		if(obj == null)
		{
			return false;
		}
		if(!(obj instanceof SysLog))
		{
			return false;
		}
		//
		return this.id.equals(((SysLog)obj).id);
	}
	//
	// Property accessors
	//
	public Integer getId()
	{
		return this.id;
	}
	
	public void setId(Integer id)
	{
		this.id = id;
	}
	
	public Date getTime()
	{
		return this.time;
	}
	
	public void setTime(Date time)
	{
		this.time = time;
	}
	
	public Integer getLevel()
	{
		return this.level;
	}
	
	public void setLevel(Integer level)
	{
		this.level = level;
	}
	
	public String getMsg()
	{
		return this.msg;
	}
	
	public void setMsg(String msg)
	{
		this.msg = msg;
	}
	
}
